#include "Element.h"
#include <memory>


int main()
{
    /*Makefile by -std=c++11 or * higher c++ version*/
    std::shared_ptr<Element<2> > e(new Quadrilateral_1_Element(),std::default_delete<Quadrilateral_1_Element>());
    std::vector<Dofs<2> > l({{0,0},{1,0},{1,1},{0,1}});
    l[0].SetGlobalIndex(0);
    l[1].SetGlobalIndex(1);
    l[2].SetGlobalIndex(4);
    l[3].SetGlobalIndex(3);
    e -> SetDofsList(l);
    for(int i = 0;i < 4;i++)
        std::cout << e ->GetDofsList(i);
    /*
    The output will be:
    0 : ( 0 , 0 )
    1 : ( 1 , 0 )
    4 : ( 1 , 1 )
    3 : ( 0 , 1 )
    */
   std::shared_ptr<Element<2> > e1(new Quadrilateral_2_Element());
    std::vector<Dofs<2> > l1({{0,0},{1,0},{1,1},{0,1},{0.5,0},{1,0.5},{0.5,0},{0,0.5},{0.5,0.5}});
   e1->SetDofsList(l1);
   for(int i = 1;i <= 9;i++)
        std::cout << e1->phi(0.5,0,i) << std::endl;
    
    std::cout << e1->det_Jacobi(-1,-1) << std::endl;

    std::shared_ptr<Element<2> > e2(new Triangular_2_Element());
    std::vector<Dofs<2> > l2({{0,0},{0.5,0},{0,0.5},{0.25,0},{0.25,0.25},{0,0.25}});
    e2 ->SetDofsList(l2);
    for(int i = 1;i <= e2->n_Dofs();i++)
        std::cout << e2 ->phi(0,1,i) << std::endl;
    std::cout << e2 ->det_Jacobi(0,0) <<std::endl;

    return 0;
}